/*============================================================================*/
/*  Copyright (C) 2009-2013, iSOFT INFRASTRUCTURE SOFTWARE CO.,LTD.
 *  
 *  All rights reserved. This software is iSOFT property. Duplication 
 *  or disclosure without iSOFT written authorization is prohibited.
 *  
 *  @file       <Fls.c>
 *  @brief      <Flash Driver>
 *  
 *  <Compiler: Tasking MCU:TC1782>
 *  
 *  @author     <Tommy>
 *  @date       <2014-11-7>
 */
/*============================================================================*/

/*=======[R E V I S I O N   H I S T O R Y]====================================*/
/*  <VERSION>    <DATE>    <AUTHOR>    <REVISION LOG>
 *  V1.0.0       20141107   Tommy      Initial version
 */

/* These MISRA-C Rules not obeyed */

/* MISRA-C:2004 Rule 17.4,
 * Msg(4:0491) Array subscripting applied to an object of pointer type.
 */
/* MISRA-C:2004 Rule 19.7,
 * Msg(4:3453) A function could probably be used instead of this function-like macro.
 */

/*============================================================================*/

/*=======[V E R S I O N  I N F O R M A T I O N]===============================*/
#define FLS_C_AR_MAJOR_VERSION   2U
#define FLS_C_AR_MINOR_VERSION   2U
#define FLS_C_AR_PATCH_VERSION   3U
#define FLS_C_SW_MAJOR_VERSION   1U
#define FLS_C_SW_MINOR_VERSION   0U
#define FLS_C_SW_PATCH_VERSION   0U


/*=======[I N C L U D E S]====================================================*/
#include "Fls.h" /** @req FLS107 */

/*=======[M A C R O S]========================================================*/


/*=======[T Y P E   D E F I N I T I O N S]====================================*/
typedef struct
{
    Fls_AddressType Address;

    P2VAR(uint8,AUTOMATIC,FLS_APPL_DATA) AddressPtr;

    Fls_LengthType Length;

    Fls_LengthType EraseSize;

    Fls_LengthType WriteSize;

    Fls_RequestJobType FlsCurrentJob;

    /* The higher 16bits: Flash Type, The lower 16bits: SectorNo */
    uint32 FlsSecotrNo;
}Fls_RuntimeDataType;

/*=======[F U N C T I O N   I M P L E M E N T A T I O N S]====================*/

/*************************************************************************/
/*
 * Brief               Erases flash sector(s).
 * ServiceId           0x1 
 * Sync/Async          Asynchronous
 * Reentrancy          Non Reentrant
 * Param-Name[in]      TargetAddress: address offset
 *                     Length:Number of bytes to erase
 * Param-Name[out]     None
 * Param-Name[in/out]  None
 * Return              None
 * PreCondition        None
 * CallByAPI           Up layer(FEE)
 */
/*************************************************************************/
/** @req FLS250 FLS218 FLS219 FLS220 FLS221 FLS020 FLS021 FLS065 FLS023 FLS115*/
FUNC(Std_ReturnType, FLS_CODE)
Fls_Erase(Fls_AddressType TargetAddress,Fls_LengthType Length)
{

    return E_OK;
}

/*************************************************************************/
/*
 * Brief               Writes one or more complete flash pages.
 * ServiceId           0x2 
 * Sync/Async          Asynchronous
 * Reentrancy          Non Reentrant
 * Param-Name[in]      TargetAddress: address offset
 *                     SourceAddressPtr:Pointer to source data buffer
 *                     Length:Number of bytes to write
 * Param-Name[out]     None
 * Param-Name[in/out]  None
 * Return              None
 * PreCondition        None
 * CallByAPI           Up layer(FEE)
 */
/*************************************************************************/
/** @req FLS251 FLS223 FLS224 FLS225 FLS226 FLS026 FLS027 FLS066 FLS030 FLS157 FLS146*/
FUNC(Std_ReturnType, FLS_CODE)
Fls_Write
(
    Fls_AddressType TargetAddress,
    P2CONST(uint8, AUTOMATIC, FLS_APPL_DATA) SourceAddressPtr,
    Fls_LengthType Length
)
{
    return E_OK;
}
/*************************************************************************/
/*
 * Brief               return the result of the last job synchronously.
 * ServiceId           0x5 
 * Sync/Async          Synchronous
 * Reentrancy          Reentrant
 * Param-Name[in]      void
 * Param-Name[out]     None
 * Param-Name[in/out]  None
 * Return              MemIf_JobResultType
 * PreCondition        None
 * CallByAPI           Up layer
 */
/*************************************************************************/
/** @req FLS254 FLS035 FLS185*/
FUNC(MemIf_JobResultType, FLS_CODE)
Fls_GetJobResult(void)
{
    return MEMIF_JOB_OK;
}


/*=======[E N D   O F   F I L E]==============================================*/
